package net;

import java.util.LinkedList;

public class ClientPool {
	private static LinkedList<Client> cliendSocket = new LinkedList<Client>();
	
	public static Client pop() {
		Client socket = null;
		synchronized (cliendSocket) {
			if(cliendSocket.size() <= 0) socket = new Client();
			else socket = cliendSocket.pop();
		}
		return socket;
	}
	public static void push(Client socket) {
		socket.clear();
		synchronized (cliendSocket) {
			cliendSocket.push(socket);
		}
	}
}